# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Martin C. Doege <mdoege at compuserve dot com>
# Contributor: Ray Rashif <schiv@archlinux.org>
# Contributor: Shinlun Hsieh <yngwiexx@yahoo.com.tw>

pkgname=qsampler
pkgver=0.9.11
pkgrel=1
pkgdesc="A LinuxSampler Qt GUI Interface"
arch=(loong64 x86_64)
url="https://qsampler.sourceforge.io/"
license=(GPL-2.0-or-later)
groups=(pro-audio)
depends=(
  gcc-libs
  glibc
  hicolor-icon-theme
  libgig libgig.so
  liblscp liblscp.so
  linuxsampler
  qt6-base
  qt6-svg
)
makedepends=(
  cmake
  qt6-tools
)
optdepends=(
  'qt6-wayland: for native wayland support'
)
source=(https://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz)
sha512sums=('cd8e33e5791d9d3c768972bd63b53bf9eeb95435247ca5c4fd2488ec4bf67e519bbecd7d4a08f701c5bf85f60710d299e9eef2f3e59e5ec4af58c6ded52b5c56')
b2sums=('a19abb43d6d7f0087094b54568b22c9391081e49464ee5626e14c24536afc51680b4f22191bb7baf6abb989f2fa548aadc1d1a1d93876bd16022bd34dfe556a5')

build() {
  local cmake_options=(
    -B build
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CONFIG_QT6=ON
    -S $pkgname-$pkgver
    -W no-dev
  )

  cmake "${cmake_options[@]}"
  cmake --build build --verbose
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -vDm 644 $pkgname-$pkgver/{ChangeLog,README} -t "$pkgdir/usr/share/doc/$pkgname/"
}
# vim:set ts=2 sw=2 et:
